using Godot;
using Godot.Collections;
using System;


public class IronDrumBlockEntity : BlockEntity
{
    public FluidData fluid = new FluidData("water", 0, 32000);
    public override Dictionary getDict()
    {
        Dictionary dict = new Dictionary();
        dict.Add("fluid", fluid.GetDictionary());
        return dict;
    }
    public override BlockEntity JsonTo(Dictionary dict)
    {
        fluid.Parse((Dictionary)dict["fluid"]);
        return this;
    }
    public override FluidData GetFluid(int index)
    {
        if (index == 0) return fluid;
        else return null;
    }
    public override FluidData GetFluid(String name)
    {
        if(fluid.amount<=0)
        {
            fluid.name=name;
            return fluid;
        }else
        if (name == fluid.name) return fluid;
        else return null;
    }
}

